# @File: login_apis.py
# -*- coding: utf-8 -*-
# __author:"super"
# @time:2025/7/31 18:55
from typing import Optional

from attrs import define, field

from apis.mock.auth.models import TokenResponseData
from get_define.api_object import BaseAPIObject
from tools.router import router


@define(kw_only=True)
@router.post("/api/login/token")
class LoginAPI(BaseAPIObject[TokenResponseData]):
    """登录"""

    @define
    class RequestBodyModel:
        username: str = field()
        password: str = field()

    request_body: RequestBodyModel
    response: Optional[TokenResponseData] = field(default=TokenResponseData)